package org.example.struct.array;

import com.alibaba.fastjson2.JSON;

/**
 * @author liyishan
 * @date 2023/8/23 09:37
 * @apiNote
 */

public class Test01480RunningSum {
    public static void main(String[] args) {
        int[] nums = {1,2,3,4};
        int[] res = test(nums);
        System.out.println(JSON.toJSON(res));
    }

    public static int[] test(int[] nums) {
        int n = nums.length;
        for(int i = 0; i < n; i++){
            nums[i] += nums[i-1];
        }
        return nums;
    }
}
